package cc.messcat.util;

/**
 * 元组
 */
public class Tuple {

	private Tuple() {
	}

	public static <A, B> Tuple2<A, B> of(A a, B b) {
		return new Tuple2<>(a, b);
	}

	public static <A, B, C> Tuple3<A, B, C> of(A a, B b, C c) {
		return new Tuple3<>(a, b, c);
	}

	public static <A, B, C, D> Tuple4<A, B, C, D> of(A a, B b, C c, D d) {
		return new Tuple4<>(a, b, c, d);
	}

	public static <A, B, C, D, E> Tuple5<A, B, C, D, E> of(A a, B b, C c, D d, E e) {
		return new Tuple5<>(a, b, c, d, e);
	}

	public static <A, B, C, D, E, F> Tuple6<A, B, C, D, E, F> of(A a, B b, C c, D d, E e, F f) {
		return new Tuple6<>(a, b, c, d, e, f);
	}

	public static <A, B, C, D, E, F, G> Tuple7<A, B, C, D, E, F, G> of(A a, B b, C c, D d, E e, F f, G g) {
		return new Tuple7<>(a, b, c, d, e, f, g);
	}

	public static class Tuple2<A, B> {
		public final A _1;
		public final B _2;

		public Tuple2(A _1, B _2) {

			this._1 = _1;
			this._2 = _2;
		}
	}

	public static class Tuple3<A, B, C> {
		public final A _1;
		public final B _2;
		public final C _3;

		public Tuple3(A _1, B _2, C _3) {

			this._1 = _1;
			this._2 = _2;
			this._3 = _3;
		}
	}

	public static class Tuple4<A, B, C, D> {
		public final A _1;
		public final B _2;
		public final C _3;
		public final D _4;

		public Tuple4(A _1, B _2, C _3, D _4) {

			this._1 = _1;
			this._2 = _2;
			this._3 = _3;
			this._4 = _4;
		}
	}

	public static class Tuple5<A, B, C, D, E> {
		public final A _1;
		public final B _2;
		public final C _3;
		public final D _4;
		public final E _5;

		public Tuple5(A _1, B _2, C _3, D _4, E _5) {

			this._1 = _1;
			this._2 = _2;
			this._3 = _3;
			this._4 = _4;
			this._5 = _5;
		}
	}

	public static class Tuple6<A, B, C, D, E, F> {
		public final A _1;
		public final B _2;
		public final C _3;
		public final D _4;
		public final E _5;
		public final F _6;

		public Tuple6(A _1, B _2, C _3, D _4, E _5, F _6) {

			this._1 = _1;
			this._2 = _2;
			this._3 = _3;
			this._4 = _4;
			this._5 = _5;
			this._6 = _6;
		}
	}

	public static class Tuple7<A, B, C, D, E, F, G> {
		public final A _1;
		public final B _2;
		public final C _3;
		public final D _4;
		public final E _5;
		public final F _6;
		public final G _7;

		public Tuple7(A _1, B _2, C _3, D _4, E _5, F _6, G _7) {

			this._1 = _1;
			this._2 = _2;
			this._3 = _3;
			this._4 = _4;
			this._5 = _5;
			this._6 = _6;
			this._7 = _7;
		}
	}

}
